
<div class="main-title">
	<h1 class="float-left"><?php echo 'Approve Course Attendence'; ?></h1>
</div>

<?php
$form = $this->beginWidget('GxActiveForm', array(
	'id' => 'bulk-approve-attendence',
	'action' => array('/cpd/course/approveAttendence','id'=>$course->id),
		));
?>
<div class="grid_16">
	<?php
	$this->widget('PsGridView', array(
		'id' => 'course-grid',
		'dataProvider' => $dataProvider,
//	'filter' => $,
		'columns' => array(
			array(
				'header' => 'Course Name',
				'type' => 'raw',
				'value' => '$data->course->name'
			),
			array(
				'header' => 'Start Time',
				'type' => 'raw',
				'value' => '$data->course->start_time'
			),
			array(
				'header' => 'End Time',
				'type' => 'raw',
				'value' => '$data->course->end_time'
			),
			array(
				'header' => 'User Name',
				'type' => 'raw',
				'value' => '$data->user->name'
			),
			array(
				'header' => 'CEA License',
				'type' => 'raw',
				'value' => '$data->user->license_no'
			),
			array(
				'header' => 'Attendence',
				'type' => 'raw',
				'value' => 'CourseAttendence::isAttendenceMarked($data->course_id, $data->user_id)?"Attended":""'
			),
			array(
				'header' => 'Approve Status',
				'type' => 'raw',
				'value' => 'CourseAttendence::isAttendenceApproved($data->course_id, $data->user_id)?"Approved":"Not yet"'
			),
			'user_id' => array(
				'class' => 'CCheckBoxColumn',
				'name' => 'user_id',
				'value' => '$data->user_id',
				'selectableRows' => 2,
				'checkBoxHtmlOptions' => array(
					'name' => 'user_id[]'
				),
				'htmlOptions' => array(
					'width' => 16,
					'disabled' => '$data->isMarkAttendence($data->course_id, $data->user_id)?"disabled":""'
				),
			),
		),
	));
	?>
</div>
<div id="">
	<label for="bulk_approve_attendence">Approve Selected Attendence</label>
	<?php echo GxHtml::submitButton(Yii::t('app', 'Approve'), array('class' => '', 'name' => 'bulk_attendence_approve')); ?>
</div>
<?php $this->endWidget(); ?>